﻿<UserControl xmlns:ParseControls="clr-namespace:ParseControls;assembly=ParseControls"  x:Class="ParseOnlineAdmin.ParseHeaderView"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:local="clr-namespace:ParseOnlineAdmin" 
			 mc:Ignorable="d" d:DesignHeight="50" d:DesignWidth="500">

	<UserControl.Resources>

		<local:ParseObjectToStringConverter x:Key="valueConverter" />

		<SolidColorBrush x:Key="transp" Color="Transparent"  Opacity="0" />
		<SolidColorBrush x:Key="snow" Color="Transparent" Opacity="0.0001" />
		<SolidColorBrush  x:Key="min"  Color="White" Opacity="0.05" />
		<SolidColorBrush  x:Key="light"  Color="White" Opacity="0.1" />
		<SolidColorBrush x:Key="over" Color="White"  Opacity="0.2" />
		<SolidColorBrush x:Key="selected"  Color="White"  Opacity="0.3" />

		<!-- FocusVisual -->
		<Style x:Key="SimpleFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Border
						BorderBrush="Transparent"
						BorderThickness="0"
						SnapsToDevicePixels="true">
							<!--
							<Border.Effect>
							<DropShadowEffect ShadowDepth="0"
							Color="Gray"
							BlurRadius="5" />
							</Border.Effect>
						-->
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="listboxitem" TargetType="ListBoxItem">
			<Setter Property="Opacity" Value="0" />
			<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
			<Setter Property="RenderTransform">
				<Setter.Value>
					<TranslateTransform Y="-10" />
				</Setter.Value>
			</Setter>
			<Setter
			Property="FocusVisualStyle"
			Value="{StaticResource SimpleFocusVisual}" />
			<Setter Property="BorderBrush" Value="#fff" />
			<Setter Property="BorderThickness" Value="0,0,0,1" />
			<Setter Property="Foreground" Value="#333" />
			<Setter Property="Background" Value="{StaticResource light}" />
			<Setter Property="HorizontalContentAlignment" Value="Stretch" />
			<Setter Property="HorizontalAlignment" Value="Stretch" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ListBoxItem">
						<Grid Background="{TemplateBinding Background}"
						SnapsToDevicePixels="true">
							<Rectangle x:Name="rectBg"
							SnapsToDevicePixels="true" />
							<Border x:Name="line"
							Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							SnapsToDevicePixels="true" />

							<ContentPresenter Margin="0"
							HorizontalAlignment="Stretch"
							Content="{TemplateBinding Content}"
							ContentTemplate="{TemplateBinding ContentTemplate}"
							SnapsToDevicePixels="true" />
						</Grid>
						<ControlTemplate.Triggers>
							<EventTrigger RoutedEvent="Loaded">
								<BeginStoryboard>
									<Storyboard Storyboard.DesiredFrameRate="30">
										<DoubleAnimation AccelerationRatio="0.3" DecelerationRatio="0.7"
										Duration="0:0:0.7" From="0"
										Storyboard.TargetProperty="Opacity" To="1" />
										<DoubleAnimation AccelerationRatio="0.3" DecelerationRatio="0.7"
										Duration="0:0:0.7" From="-10"
										Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
										To="0" />
									</Storyboard>
								</BeginStoryboard>
							</EventTrigger>
							<Trigger Property="IsSelected" Value="True">
								<Setter Property="Opacity" TargetName="line" Value="1" />
								<Setter Property="Fill" TargetName="rectBg" Value="#007ACC" />
								<Setter Property="TextBlock.Foreground" Value="#fff" />
							</Trigger>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelected" Value="False" />
									<Condition Property="IsMouseOver" Value="True" />
								</MultiTrigger.Conditions>
								<Setter Property="Opacity" TargetName="line" Value="1" />
								<Setter Property="BorderThickness" TargetName="line" Value="0,0,0,1" />
								<Setter Property="BorderBrush" TargetName="line" Value="#007ACC" />
								<Setter Property="Cursor" Value="Hand" />
								<Setter Property="Fill" TargetName="rectBg" Value="#fff" />
								<Setter Property="Opacity" TargetName="rectBg" Value="0.5" />
							</MultiTrigger>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelected" Value="True" />
									<Condition Property="IsMouseOver" Value="True" />
								</MultiTrigger.Conditions>
								<Setter Property="Opacity" TargetName="line" Value="1" />
							</MultiTrigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Background" Value="Silver" />
					<Setter Property="Foreground" Value="White" />
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="listbox" TargetType="{x:Type ListBox}">
			<Setter  Property="BorderThickness"  Value="0" />
			<Setter  Property="Margin"  Value="0" />
			<Setter  Property="Padding"  Value="0" />
			<Setter Property="Background"  Value="{StaticResource snow}" />
		</Style>
		<Style x:Key="textbox" TargetType="{x:Type TextBox}">
			<Setter Property="Background" Value="Transparent" />
			<Setter Property="BorderThickness" Value="0" />
			<Setter Property="Padding" Value="3" />
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontWeight" Value="Bold" />
			<Setter Property="VerticalContentAlignment" Value="Center" />
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="true">
					<Setter Property="Background" Value="{StaticResource over}" />
					<Setter  Property="BorderThickness"  Value="0" />
				</Trigger>
				<Trigger  Property="IsFocused" Value="true">
					<Setter  Property="Background" Value="{StaticResource selected}" />
					<Setter  Property="BorderThickness" Value="0" />
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="searchBox" TargetType="{x:Type TextBox}">
			<Setter Property="Background" Value="Transparent" />
			<Setter Property="BorderThickness" Value="0" />
			<Setter Property="Padding" Value="3" />
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontWeight" Value="Bold" />
			<Setter Property="VerticalContentAlignment" Value="Center" />
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="true">
					<Setter Property="Background" Value="{StaticResource min}" />
					<Setter  Property="BorderThickness"  Value="0" />
				</Trigger>
				<Trigger  Property="IsFocused" Value="true">
					<Setter  Property="Background" Value="{StaticResource light}" />
					<Setter  Property="BorderThickness" Value="0" />
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="button" TargetType="{x:Type Button}">
			<Setter Property="Background" Value="Transparent" />
			<Setter Property="BorderBrush" Value="{StaticResource selected}" />
			<Setter Property="BorderThickness" Value="0" />
			<Setter Property="Padding" Value="3" />
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="true">
					<Setter  Property="BorderThickness"  Value="1" />
					<Setter Property="Background" Value="Transparent" />
				</Trigger>
				<Trigger  Property="IsFocused" Value="true">
					<Setter  Property="BorderThickness" Value="1" />
					<Setter Property="Background" Value="Transparent" />
				</Trigger>
			</Style.Triggers>
		</Style>

		<!-- Shadow -->
		<DropShadowEffect x:Key="shadowDark" BlurRadius="15" 
					  ShadowDepth="5" Color="#777777" 
				Direction="270" RenderingBias="Performance" />

	</UserControl.Resources>

	<Border>

		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="3*"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="Auto"/>
			</Grid.ColumnDefinitions>

			<Border Height="30" Width="30" Margin="5" CornerRadius="5" Background="#fff" ClipToBounds="True">
				<Image x:Name="imgProfile" VerticalAlignment="Top" Stretch="UniformToFill" 
				     ClipToBounds="True"  />
			</Border>


			<ParseControls:FwButton x:Name="btnAccount" Content="ACCOUNT" Margin="5" Grid.Column="1"
				VerticalAlignment="Center" Foreground="#fff" Click="btnAccount_Click"
				FontWeight="Bold" FontSize="16" Height="30" />

			<ParseControls:FwTextBox x:Name="txtSearch" BackgroundText="Suchen oder mit Enter erstellen..."
					Text="{Binding Path=Matchcode, Mode=TwoWay, 
						UpdateSourceTrigger=PropertyChanged, Delay=350}" 
					KeyUp="TextBox_KeyUp" Style="{StaticResource searchBox}"
						Margin="5" Grid.Column="3" Height="24" />

			<TextBlock Text="THE CLIENT for PARSE.COM" VerticalAlignment="Center"  Margin="15,5"
				   FontSize="16" Foreground="#fff" FontWeight="Bold" Grid.Column="5" />

			<ParseControls:FwButton x:Name="btnMin" Width="30" Height="30" Click="btnMin_Click"
				Margin="5" Grid.Column="6"
				Style="{StaticResource button}">
				<ParseControls:FwButton.Content>
					<Viewbox>
						<Canvas x:Name="appbar_app_minus" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-5">
							<Path Width="40" Height="30" Canvas.Left="18" Canvas.Top="23" Stretch="Fill" 
							  Fill="#FFffffff" Data="F1 M 18,23L 58,23L 58,53L 18,53L 18,23 Z M 54,31L 22,31L 22,49L 54,49L 54,31 Z M 45,38L 45,42L 31,42L 31,38L 45,38 Z "/>
						</Canvas>
					</Viewbox>
				</ParseControls:FwButton.Content>
			</ParseControls:FwButton>
			<ParseControls:FwButton x:Name="btnMax" Width="30" Height="30" Click="btnMax_Click"
				Margin="5" Grid.Column="7"
				Style="{StaticResource button}">
				<ParseControls:FwButton.Content>
					<Viewbox>
						<Canvas x:Name="appbar_window_maximize" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-5">
							<Path Width="38" Height="38" Canvas.Left="19" Canvas.Top="19" Stretch="Fill" 
							  Fill="#FFffffff" Data="F1 M 43,48L 46,48L 46,57L 19,57L 19,34L 32,34L 32,40L 22,40L 22,54L 43,54L 43,48 Z M 21,19L 57,19L 57,50L 49,50L 49,46L 53,46L 53,27L 25,27L 25,32L 21,32L 21,19 Z M 37.75,30L 50,30L 50,42.25L 46,46.25L 46,37.25L 38,45.25L 34.75,42L 42.75,34L 33.75,34L 37.75,30 Z "/>
						</Canvas>
					</Viewbox>
				</ParseControls:FwButton.Content>
			</ParseControls:FwButton>
			<ParseControls:FwButton Click="Button_Click" Width="30" Height="30"
				Margin="5" Grid.Column="8"
				Style="{StaticResource button}">
				<ParseControls:FwButton.Content>
					<Viewbox>
						<Canvas Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-5">
							<Path Width="31.6666" Height="31.6667" Canvas.Left="22.1666" Canvas.Top="22.1667" 
							  Stretch="Fill" Fill="#FFffffff" Data="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z "/>
						</Canvas>
					</Viewbox>
				</ParseControls:FwButton.Content>
			</ParseControls:FwButton>
		</Grid>

	</Border>

</UserControl>
